package com.elink.enginerring.common;

/**
 * E币hession传递的type的类型
 * @author hxjxiaojun
 *@time 2017年1月16日
 */
public enum CoinEnum {
	
	UPLOADDATABASE("上传工程资料",26),
	UPLOADLIBRARY("上传论文图书馆资料",27),
	DOWNLOADDATABASE("下载工程资料",28),
	DOWNLOADLIBRARY("下载论文图书馆资料",29),
	POSTBESTANSWER("最佳答案",17),
	ADDPOST("提问",18),
	PRAISEFILE("点赞资料",19),
	PRAISELIBRARY("点赞论文",20),
	PRAISECOMPANY("点赞企业",21),
	PRAISEVIDEO("点赞视频",22),
	PRAISECOURSE("点赞课程",23);

	

	// 成员变量
	private String name;
	private int index;

	// 构造方法
	private CoinEnum(String name, int index) {
		this.name = name;
		this.index = index;
	}

	// 普通方法
	public static String getName(int index) {
		for (CoinEnum c : CoinEnum.values()) {
			if (c.getIndex() == index) {
				return c.name;
			}
		}
		return null;
	}

	// get set 方法
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}
	
	public static void main(String[] args) {
		System.out.println(CoinEnum.UPLOADDATABASE.getName());
	}
}
